VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Form2 
   Caption         =   "Form2"
   ClientHeight    =   3030
   ClientLeft      =   120
   ClientTop       =   450
   ClientWidth     =   4560
   LinkTopic       =   "Form2"
   ScaleHeight     =   3030
   ScaleWidth      =   4560
   StartUpPosition =   3  'Windows Default
   Begin MSComctlLib.ListView ListView2 
      Height          =   3015
      Left            =   7560
      TabIndex        =   1
      Top             =   1680
      Width           =   5295
      _ExtentX        =   9340
      _ExtentY        =   5318
      View            =   3
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      FullRowSelect   =   -1  'True
      GridLines       =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      NumItems        =   4
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Text            =   "thietbi1"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   1
         Text            =   "thietbi2"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   2
         Text            =   "thietbi3"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   3
         Text            =   "thietbi4"
         Object.Width           =   2540
      EndProperty
   End
   Begin VB.TextBox Text1 
      Height          =   735
      Left            =   5040
      TabIndex        =   0
      Top             =   240
      Width           =   3015
   End
   Begin VB.Timer Timer1 
      Left            =   720
      Top             =   480
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As ADODB.Recordset
Dim rs1 As ADODB.Recordset
Dim strsql As String
Dim mysql As String

Private Sub Form_Load()
Timer1.Interval = 500
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
strsql = "select * from thietbi"
Set rs = cn.Execute(strsql)
Text1.Text = rs("thietbi1").Value
Set rs = Nothing
Me.filllistview2

End Sub
Sub filllistview2()
strsql = "select * from thietbi"
Set rs = cn.Execute(strsql)
ListView2.ListItems.Clear
Do While Not rs.EOF
Set Item = ListView2.ListItems.Add(, , rs!thietbi1)
Item.SubItems(1) = rs!thietbi2 & ""
Item.SubItems(2) = rs!thietbi3 & ""
Item.SubItems(3) = rs!thietbi4 & ""
rs.MoveNext
Loop
Set rs = Nothing
End Sub

